package com.nbsaas.boot.wms.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

import java.math.BigDecimal;
import java.util.Date;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "商品配货明细", model = "商品配货明细")
@Entity
@Table(name = "bs_product_allocation_detail")
@Comment("商品配货明细表")
public class ProductAllocationDetail extends AbstractEntity {

    @Comment("配货ID")
    @FormField(title = "配货ID", sortNum = "1", grid = true, required = true)
    private Long allocationId;

    @Comment("商品ID")
    @FormField(title = "商品ID", sortNum = "2", grid = true, required = true)
    private Long productId;

    @Comment("SKU ID")
    @FormField(title = "SKU ID", sortNum = "3", grid = true, required = true)
    private Long skuId;

    @Comment("店铺ID")
    @FormField(title = "店铺ID", sortNum = "4", grid = true, required = true)
    private Long shopId;

    @Comment("仓库ID")
    @FormField(title = "仓库ID", sortNum = "5", grid = true, required = true)
    private Long warehouseId;

    @Comment("货位ID")
    @FormField(title = "货位ID", sortNum = "6", grid = true)
    private Long locationId;

    @Comment("配货数量")
    @FormField(title = "配货数量", sortNum = "7", grid = true, type = InputType.el_input_number, sort = true)
    private Integer allocationQuantity;

    @Comment("实际配货数量")
    @FormField(title = "实际配货数量", sortNum = "8", grid = true, type = InputType.el_input_number, sort = true)
    private Integer actualQuantity;

    @Comment("配货单价")
    @FormField(title = "配货单价", sortNum = "9", grid = true, type = InputType.el_input_number)
    @Column(precision = 10, scale = 2)
    private BigDecimal unitPrice;

    @Comment("配货总金额")
    @FormField(title = "配货总金额", sortNum = "10", grid = true, type = InputType.el_input_number, sort = true)
    @Column(precision = 10, scale = 2)
    private BigDecimal totalAmount;

    @Comment("配货状态")
    @FormField(title = "配货状态", sortNum = "11", grid = true, type = InputType.select)
    @Column(length = 20)
    private String status; // PENDING-待配货, PROCESSING-配货中, COMPLETED-已完成, CANCELLED-已取消

    @Comment("配货类型")
    @FormField(title = "配货类型", sortNum = "12", grid = true, type = InputType.select)
    @Column(length = 20)
    private String allocationType; // NORMAL-正常配货, PROMOTION-促销配货, RESERVED-预留配货

    @Comment("配货批次号")
    @FormField(title = "配货批次号", sortNum = "13", grid = true)
    @Column(length = 100)
    private String batchNo;

    @Comment("配货开始时间")
    @FormField(title = "配货开始时间", sortNum = "14", grid = true, type = InputType.date)
    private Date allocationStartTime;

    @Comment("配货完成时间")
    @FormField(title = "配货完成时间", sortNum = "15", grid = true, type = InputType.date)
    private Date allocationEndTime;

    @Comment("配货人ID")
    @FormField(title = "配货人ID", sortNum = "16", grid = true)
    private Long allocatorId;

    @Comment("配货人姓名")
    @FormField(title = "配货人姓名", sortNum = "17", grid = true)
    @Column(length = 100)
    private String allocatorName;

    @Comment("配货备注")
    @FormField(title = "配货备注", sortNum = "18", type = InputType.richText, col = 23)
    @Column(length = 1000)
    private String note;
} 